package com.yt.util;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

@Slf4j
public class MyBlockHandler {
    //测试失败，感觉好像是少了静态

    /**
     * 必须是public
     * @param be  参数类型需要和原方法相匹配，并在最后加上BlockException类型的参数
     * @return 返回类型与原方法一致
     */
    public static CommonResult<Date> handlerException(BlockException be){
        log.warn("执行熔断方法1");
        return new CommonResult<>(404,"byres error  -1",new Date());
    }
    public static CommonResult<Date> handlerException2(BlockException be){
        log.warn("执行熔断方法2");
        return new CommonResult<>(404,"byres error  -2",new Date());
    }
}
